import { message } from "ant-design-vue";

export function copyText(text?: any | null | undefined) {
  text = text?.toString();
  if (!text) return;
  navigator.clipboard
    .writeText(text)
    .then(() => void message.success("复制成功"))
    .catch(() => void message.error("复制失败"));
}
